/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/*************************************************************************
 *\author: starlove
 *************************************************************************/
#ifndef __CC_PYTHON_IMPORT_O_NODES_IMPL__
#define __CC_PYTHON_IMPORT_O_NODES_IMPL__

#include "python_object_nodeobjects.h"
#include "python_object_action.h"
#include "python_object_protocols.h"

NS_CCPY_BEGIN
	PYCLASS_INIT_F(CPyPointer, "CPointer", "Python CPointer Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyPointer)
	PYCLASS_END_METHOD_DEF(CPyPointer)
	PYCLASS_BEGIN_GETSET_DEF(CPyPointer)
	PYCLASS_ADD_GETSET(CPyPointer, ptr)
	PYCLASS_ADD_GETSET(CPyPointer, size)
	PYCLASS_END_GETSET_DEF(CPyPointer)
	PYCLASS_IMP_INTERFACE(CPyPointer);
	PYCLASS_GET_IMPL(CPyPointer, ptr)
	{
		return Py_BuildValue("I", reinterpret_cast<unsigned int>(pySelf->getPtr()));
	}

	PYCLASS_SET_IMPL(CPyPointer, ptr)
	{
		pySelf->setPtr(reinterpret_cast<void *>(PyLong_AsUnsignedLong(pyValue)));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyPointer, size)
	{
		return Py_BuildValue("I", pySelf->getSize());
	}
	PYCLASS_SET_IMPL(CPyPointer, size)
	{
		pySelf->setSize(PyLong_AsUnsignedLong(pyValue));
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	
	CCNODE_OBJECT_WRAPPER_IMPL(CCNode, CPyNode)
	CCNODE_OBJECT_WRAPPER_IMPL(CCNodeRGBA, CPyNodeRGBA)
	CCNODE_OBJECT_WRAPPER_IMPL(CCScene, CPyScene)

	PYCLASS_INIT_F(CPyCCObject, "CCObject", "Python CCObject Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyCCObject)
	PYCLASS_ADD_METHOD(CPyCCObject,typeto)
	PYCLASS_ADD_METHOD(CPyCCObject,release)
	PYCLASS_ADD_METHOD(CPyCCObject,retain)
	PYCLASS_ADD_METHOD(CPyCCObject,autorelease)
	PYCLASS_ADD_METHOD(CPyCCObject,copy)
	PYCLASS_ADD_METHOD(CPyCCObject,isSingleReference)
	PYCLASS_ADD_METHOD(CPyCCObject,retainCount)
	PYCLASS_ADD_METHOD(CPyCCObject,isEqual)
	PYCLASS_ADD_METHOD(CPyCCObject,update)
	PYCLASS_END_METHOD_DEF(CPyCCObject)
	PYCLASS_BEGIN_GETSET_DEF(CPyCCObject)
	PYCLASS_END_GETSET_DEF(CPyCCObject)
	PYCLASS_IMP_INTERFACE(CPyCCObject)
	
	PYCLASS_METHOD_IMPL(CPyCCObject,typeto)
	{
		PyObject *ptype = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &ptype) )
			Py_RETURN_NONE;
		PyObject *po = (PyObject *)CPyCCObject::create_object((PyTypeObject *)ptype, pySelf->getCCObject());
		if(!po)
			Py_RETURN_NONE;
		return po;
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,release)
	{
		CC_METHOD_WRAPPER_SETER(cocos2d::CCObject *, CPyCCObject, release);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,retain)
	{
		CC_METHOD_WRAPPER_SETER(cocos2d::CCObject *, CPyCCObject, retain);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,update)
	{
		float f = 0;
		if( !PyArg_ParseTuple(pyArgs, "f", &f) )
			Py_RETURN_NONE;
		//CC_METHOD_WRAPPER_SETER(cocos2d::CCObject *, CPyCCObject, update, f);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,autorelease)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCObject *, CPyCCObject, autorelease, cocos2d::CCObject *);
		CPyCCObject *o = CPyCCObject::create<CPyCCObject>(v);
		if(o)
			return (PyObject *)o;
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,copy)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCObject *, CPyCCObject, copy, cocos2d::CCObject *);
		CPyCCObject *o = CPyCCObject::create<CPyCCObject>(v);
		if(o)
			return (PyObject *)o;
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,isSingleReference)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCObject *, CPyCCObject, isSingleReference, bool);
		Py_RETURN_BOOL(v);
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,retainCount)
	{
		CC_METHOD_WRAPPER_GETER(cocos2d::CCObject *, CPyCCObject, retainCount, unsigned int);
		return Py_BuildValue("I", v);
	}
	PYCLASS_METHOD_IMPL(CPyCCObject,isEqual)
	{
		PyObject *o = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &o) )
			Py_RETURN_NONE;
		if(!PyObject_TypeCheck(o, CPyClassBase::GetTypeObject<CPyCCObject>()))
			Py_RETURN_NONE;
		CPyCCObject *cco = (CPyCCObject *)o;
		CC_METHOD_WRAPPER_GETER(cocos2d::CCObject *, CPyCCObject, isEqual, bool, cco->getCCObject());
		Py_RETURN_BOOL(v);
	}
	/////////////////////////////////////////////////////////////////////	
	PYCLASS_INIT_AND_BASE(CPyNode, CPyCCObject, "CCNode", "Python Node Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyNode)
	PYCLASS_ADD_METHOD(CPyNode,getChildByTag)
	PYCLASS_ADD_METHOD(CPyNode,removeFromParent)
	PYCLASS_ADD_METHOD(CPyNode,removeFromParentAndCleanup)
	PYCLASS_ADD_METHOD_EX(CPyNode,addChild					,METH_KEYWORDS|METH_VARARGS)
	PYCLASS_ADD_METHOD_EX(CPyNode,removeChild				,METH_KEYWORDS|METH_VARARGS)
	PYCLASS_ADD_METHOD_EX(CPyNode,removeChildByTag			,METH_KEYWORDS|METH_VARARGS)
	PYCLASS_ADD_METHOD(CPyNode,removeAllChildren)
	PYCLASS_ADD_METHOD(CPyNode,removeAllChildrenWithCleanup)
	PYCLASS_ADD_METHOD(CPyNode,reorderChild)
	PYCLASS_ADD_METHOD(CPyNode,sortAllChildren)
	PYCLASS_ADD_METHOD(CPyNode,onEnter)
	PYCLASS_ADD_METHOD(CPyNode,onEnterTransitionDidFinish)
	PYCLASS_ADD_METHOD(CPyNode,onExit)
	PYCLASS_ADD_METHOD(CPyNode,onExitTransitionDidStart)
	PYCLASS_ADD_METHOD(CPyNode,cleanup)
	PYCLASS_ADD_METHOD(CPyNode,draw)
	PYCLASS_ADD_METHOD(CPyNode,visit)
	PYCLASS_ADD_METHOD(CPyNode,runAction)
	PYCLASS_ADD_METHOD(CPyNode,stopAllActions)
	PYCLASS_ADD_METHOD(CPyNode,stopAction)
	PYCLASS_ADD_METHOD(CPyNode,stopActionByTag)
	PYCLASS_ADD_METHOD(CPyNode,getActionByTag)
	PYCLASS_ADD_METHOD(CPyNode,isScheduled)
	PYCLASS_ADD_METHOD(CPyNode,scheduleUpdate)
	PYCLASS_ADD_METHOD(CPyNode,scheduleUpdateWithPriority)
	PYCLASS_ADD_METHOD(CPyNode,unscheduleUpdate)
	PYCLASS_ADD_METHOD(CPyNode,schedule)
	PYCLASS_ADD_METHOD(CPyNode,scheduleOnce)
	PYCLASS_ADD_METHOD(CPyNode,unschedule)
	PYCLASS_ADD_METHOD(CPyNode,unscheduleAllSelectors)
	PYCLASS_ADD_METHOD(CPyNode,resumeSchedulerAndActions)
	PYCLASS_ADD_METHOD(CPyNode,pauseSchedulerAndActions)
	PYCLASS_ADD_METHOD(CPyNode,transform)
	PYCLASS_ADD_METHOD(CPyNode,transformAncestors)
	PYCLASS_ADD_METHOD(CPyNode,updateTransform)
	PYCLASS_ADD_METHOD(CPyNode,nodeToParentTransform)
	PYCLASS_ADD_METHOD(CPyNode,parentToNodeTransform)
	PYCLASS_ADD_METHOD(CPyNode,nodeToWorldTransform)
	PYCLASS_ADD_METHOD(CPyNode,worldToNodeTransform)
	PYCLASS_ADD_METHOD(CPyNode,convertToNodeSpace)
	PYCLASS_ADD_METHOD(CPyNode,convertToWorldSpace)
	PYCLASS_ADD_METHOD(CPyNode,convertToNodeSpaceAR)
	PYCLASS_ADD_METHOD(CPyNode,convertToWorldSpaceAR)
	PYCLASS_ADD_METHOD(CPyNode,convertTouchToNodeSpace)
	PYCLASS_ADD_METHOD(CPyNode,convertTouchToNodeSpaceAR)
	PYCLASS_ADD_METHOD(CPyNode,setAdditionalTransform)
	PYCLASS_END_METHOD_DEF(CPyNode)
	PYCLASS_BEGIN_GETSET_DEF(CPyNode)
	PYCLASS_ADD_GETSET(CPyNode,ZOrder)
	PYCLASS_ADD_GETSET(CPyNode,VertexZ)
	PYCLASS_ADD_GETSET(CPyNode,ScaleX)
	PYCLASS_ADD_GETSET(CPyNode,ScaleY)
	PYCLASS_ADD_GETSET(CPyNode,Scale)
	PYCLASS_ADD_GETSET(CPyNode,Position)
	PYCLASS_ADD_GETSET(CPyNode,PositionX)
	PYCLASS_ADD_GETSET(CPyNode,PositionY)
	PYCLASS_ADD_GETSET(CPyNode,SkewX)
	PYCLASS_ADD_GETSET(CPyNode,SkewY)
	PYCLASS_ADD_GETSET(CPyNode,AnchorPoint)
	PYCLASS_ADD_GETSET(CPyNode,ContentSize)
	PYCLASS_ADD_GETSET(CPyNode,Visible)
	PYCLASS_ADD_GETSET(CPyNode,Rotation)
	PYCLASS_ADD_GETSET(CPyNode,RotationX)
	PYCLASS_ADD_GETSET(CPyNode,RotationY)
	PYCLASS_ADD_GETSET(CPyNode,OrderOfArrival)
	PYCLASS_ADD_GETSET(CPyNode,GLServerState)
	PYCLASS_ADD_GETSET(CPyNode,ignoreAnchorPointForPosition)
	PYCLASS_ADD_GETSET(CPyNode,Parent)
	PYCLASS_ADD_GETSET(CPyNode,Grid)
	PYCLASS_ADD_GETSET(CPyNode,Tag)
	PYCLASS_ADD_GETSET(CPyNode,UserData)
	PYCLASS_ADD_GETSET(CPyNode,UserObject)
	PYCLASS_ADD_GETSET(CPyNode,ShaderProgram)
	PYCLASS_ADD_GETSET(CPyNode,ActionManager)
	PYCLASS_ADD_GETSET(CPyNode,Scheduler)
	PYCLASS_ADD_GET(CPyNode, description)
	PYCLASS_ADD_GET(CPyNode,AnchorPointInPoints)
	PYCLASS_ADD_GET(CPyNode,Children)
	PYCLASS_ADD_GET(CPyNode,ChildrenCount)
	PYCLASS_ADD_GET(CPyNode,Camera)
	PYCLASS_ADD_GET(CPyNode,isRunning)
	PYCLASS_ADD_GET(CPyNode,numberOfRunningActions)
	PYCLASS_ADD_GET(CPyNode,boundingBox)
	PYCLASS_END_GETSET_DEF(CPyNode)
	PYCLASS_IMP_INTERFACE(CPyNode)
	
	PYCLASS_GET_IMPL(CPyNode,description)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, description, const char *);
		return Py_BuildValue("s",v);
	}
	PYCLASS_GET_IMPL(CPyNode,ZOrder)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getZOrder, int);
		return Py_BuildValue("i", v);
	}
	PYCLASS_SET_IMPL(CPyNode,ZOrder)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setZOrder, PyLong_AsLong(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,VertexZ)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getVertexZ, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,VertexZ)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setVertexZ, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,ScaleX)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getScaleX, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,ScaleX)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setScaleX, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,ScaleY)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getScaleY, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,ScaleY)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setScaleY, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Scale)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getScale, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,Scale)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setScale, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Position)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getPosition, cocos2d::CCPoint);
		CPyPoint *pypt = CPyPoint::create(v);
		if(!pypt)
			Py_RETURN_NONE;
		return (PyObject *)pypt;
	}
	PYCLASS_SET_IMPL(CPyNode,Position)
	{
		cocos2d::CCPoint pt;
		FROM_PYGETSETPARAM_TO_CCOBJECT(CPyPoint, pt);
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setPosition, pt);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,PositionX)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getPositionX, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,PositionX)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setPositionX, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,PositionY)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getPositionY, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,PositionY)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setPositionY, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,SkewX)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getSkewX, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,SkewX)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setSkewX, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,SkewY)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getSkewY, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,SkewY)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setSkewY, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,AnchorPoint)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getAnchorPoint, cocos2d::CCPoint);
		CPyPoint *pypt = CPyPoint::create(v);
		if(!pypt)
			Py_RETURN_NONE;
		return (PyObject *)pypt;
	}
	PYCLASS_SET_IMPL(CPyNode,AnchorPoint)
	{
		cocos2d::CCPoint pt;
		FROM_PYGETSETPARAM_TO_CCOBJECT(CPyPoint, pt);
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setAnchorPoint, pt);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,AnchorPointInPoints)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getAnchorPointInPoints, cocos2d::CCPoint);
		CPyPoint *pypt = CPyPoint::create(v);
		if(!pypt)
			Py_RETURN_NONE;
		return (PyObject *)pypt;
	}
	PYCLASS_GET_IMPL(CPyNode,ContentSize)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getContentSize, cocos2d::CCSize);
		CPySize *pysi = CPySize::create(v);
		if(!pysi)
			Py_RETURN_NONE;
		return (PyObject *)pysi;
	}
	PYCLASS_SET_IMPL(CPyNode,ContentSize)
	{
		cocos2d::CCSize si;
		FROM_PYGETSETPARAM_TO_CCOBJECT(CPySize, si);
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setContentSize, si);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Visible)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, isVisible, bool);
		Py_RETURN_BOOL(v);
	}
	PYCLASS_SET_IMPL(CPyNode,Visible)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setVisible, pyValue == Py_True);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Rotation)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getRotation, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,Rotation)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setRotation, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,RotationX)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getRotationX, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,RotationX)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setRotationX, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,RotationY)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getRotationY, float);
		return Py_BuildValue("f", v);
	}
	PYCLASS_SET_IMPL(CPyNode,RotationY)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setRotationY, PyFloat_AsDouble(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,OrderOfArrival)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getOrderOfArrival, unsigned int);
		return Py_BuildValue("I", v);
	}
	PYCLASS_SET_IMPL(CPyNode,OrderOfArrival)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setOrderOfArrival, PyLong_AsLong(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,GLServerState)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getGLServerState, unsigned int);
		return Py_BuildValue("I", v);
	}
	PYCLASS_SET_IMPL(CPyNode,GLServerState)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setGLServerState, (cocos2d::ccGLServerState)PyLong_AsLong(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,ignoreAnchorPointForPosition)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, isIgnoreAnchorPointForPosition, bool);
		Py_RETURN_BOOL(v);
	}
	PYCLASS_SET_IMPL(CPyNode,ignoreAnchorPointForPosition)
	{
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, ignoreAnchorPointForPosition, pyValue == Py_True);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode, Children)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getChildren, cocos2d::CCArray *);
		if(!v)
			PyTuple_New(0);
		unsigned int nl = v->count();
		PyObject *pyList = PyList_New(0);
		for(unsigned int i = 0; i < nl; i ++)
		{
			cocos2d::CCObject *o = v->objectAtIndex(i);
			if(!o)
			{
				//PyList_Append(pyList, Py_None);
			}
			else
			{
				IWrapper *wrap = dynamic_cast<IWrapper *>(o);
				if(wrap)
				{
					if(wrap->GetPythonObject())
					{
						//Py_XINCREF(wrap->GetPythonObject());
						CCLog("wrap ref 1: %d", wrap->GetPythonObject()->ob_refcnt);
						PyList_Append(pyList, wrap->GetPythonObject());
						CCLog("wrap ref 2: %d", wrap->GetPythonObject()->ob_refcnt);
					}else
						PyList_Append(pyList, CPyCCObject::create_object(wrap->GetPythonType(), o));
				}else
					PyList_Append(pyList, (PyObject *)CPyCCObject::create<CPyNode>(o));
			}
		}
		PyObject *py = PyList_AsTuple(pyList);
		Py_SAFE_DECREF(pyList);
		return py;
	}
	PYCLASS_GET_IMPL(CPyNode,ChildrenCount)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getChildrenCount, unsigned int);
		return Py_BuildValue("I", v);
	}
	PYCLASS_GET_IMPL(CPyNode,Parent)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getParent, cocos2d::CCNode *);
		if(!v)
			Py_RETURN_NONE;
		IWrapper *wrap = dynamic_cast<IWrapper *>(v);
		if(wrap)
		{
			if(wrap->GetPythonObject())
			{
				Py_XINCREF(wrap->GetPythonObject());
				return (wrap->GetPythonObject());
			}
			return CPyCCObject::create_object(wrap->GetPythonType(), v);
		}else
			return (PyObject *)CPyCCObject::create<CPyNode>(v);
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyNode,Parent)
	{
		if(!pyValue || pyValue == Py_None)
			return 0;
		CPyCCObject *pv = (CPyCCObject *)pyValue;
		if(!pv)
			return 0;
		cocos2d::CCNode *node = dynamic_cast<cocos2d::CCNode *>(pv->getCCObject());
		if(!node)
			return 0;
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setParent, node);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Grid)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyNode,Grid)
	{
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Tag)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getTag, int);
		return Py_BuildValue("i", v);
	}
	PYCLASS_SET_IMPL(CPyNode,Tag)
	{
		//cocos2d::CCLog("setTag: %d", PyLong_AsLong(pyValue));
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setTag, PyLong_AsLong(pyValue));
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,UserData)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getUserData, void *);
		if(v)
			return (PyObject *)v;
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyNode,UserData)
	{
		if(!pyValue)
			return 0;
		Py_INCREF(pyValue);
		CCNODE_GETSET_WRAPPER_SETER(CPyNode, setUserData, pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,UserObject)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getUserObject, cocos2d::CCObject *);
		CPyCCObject *node = CPyCCObject::create<CPyCCObject>(v);
		if(node)
			return (PyObject *)node;
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyNode,UserObject)
	{
		CPyCCObject *pv = (CPyCCObject *)pyValue;
		if(!pv)
			return 0;
		if(pv->getCCObject())
		{
			CCNODE_GETSET_WRAPPER_SETER(CPyNode, setUserObject, pv->getCCObject());
		}
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,ShaderProgram)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyNode,ShaderProgram)
	{
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Camera)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_GET_IMPL(CPyNode,isRunning)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, isRunning, bool);
		Py_RETURN_BOOL(v);
	}
	PYCLASS_SET_IMPL(CPyNode,ActionManager)
	{
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,ActionManager)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_GET_IMPL(CPyNode,numberOfRunningActions)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, numberOfRunningActions, unsigned int);
		return Py_BuildValue("I", v);
	}
	PYCLASS_SET_IMPL(CPyNode,Scheduler)
	{
		CPyCCObject *pv = (CPyCCObject *)pyValue;
		if(!pv)
			return 0;
		cocos2d::CCScheduler *scheduler = dynamic_cast<cocos2d::CCScheduler *>(pv->getCCObject());
		if(scheduler)
		{
			CCNODE_GETSET_WRAPPER_SETER(CPyNode, setScheduler, scheduler);
		}
		return 0;
	}
	PYCLASS_GET_IMPL(CPyNode,Scheduler)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, getScheduler, cocos2d::CCScheduler *);
		CPyCCObject *node = CPyCCObject::create<CPyCCObject>(v);
		if(node)
			return (PyObject *)node;
		Py_RETURN_NONE;
	}
	PYCLASS_GET_IMPL(CPyNode, boundingBox)
	{
		CCNODE_GETSET_WRAPPER_GETER(CPyNode, boundingBox, cocos2d::CCRect);
		return (PyObject *)CPyRect::create(v);
	}

	PYCLASS_METHOD_KW_IMPL(CPyNode,addChild)
	{
		//cocos2d::CCLog("addChild begin...");
		if( !pyArgs )
			Py_RETURN_NONE;
		cocos2d::CCNode *node = NULL;
		static char* kwlist[] = {"child", "zOrder", "tag", NULL};
		PyObject *child 	= NULL;
		int zOrder 			= 0;
		int tag 			= -1;
		bool b = PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"O|ii",kwlist,&child,&zOrder,&tag) == 0;
		if(b)
			Py_RETURN_NONE;
		if(!child || child == Py_None)
			Py_RETURN_NONE;
		CPyCCObject *pv = (CPyCCObject *)child;
		if(!pv)
			Py_RETURN_NONE;
		node = dynamic_cast<cocos2d::CCNode *>(pv->getCCObject());
		if(node)
		{
			if(tag < 0)
				tag = node->getTag();
			CCNODE_METHOD_WRAPPER_SETER(CPyNode, addChild, node, zOrder, tag);
			//cocos2d::CCLog("addChild ok");
		}
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,getChildByTag)
	{
		int i = 0;
		if( !PyArg_ParseTuple(pyArgs, "i", &i) )
			Py_RETURN_NONE;
		//cocos2d::CCLog("getChildByTag: %d", i);
		CCNODE_METHOD_WRAPPER_GETER(CPyNode, getChildByTag, cocos2d::CCNode *, i);
		if(!v)
			Py_RETURN_NONE;
		IWrapper *wrap = dynamic_cast<IWrapper *>(v);
		if(wrap)
		{
			if(wrap->GetPythonObject())
			{
				Py_XINCREF(wrap->GetPythonObject());
				return (wrap->GetPythonObject());
			}
			return CPyCCObject::create_object(wrap->GetPythonType(), v);
		}else
			return (PyObject *)CPyCCObject::create<CPyNode>(v);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,removeFromParent)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, removeFromParent);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,removeFromParentAndCleanup)
	{
		PyObject *pv = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pv) )
			Py_RETURN_NONE;
		bool v = pv == Py_True;
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, removeFromParentAndCleanup, v);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_KW_IMPL(CPyNode,removeChild)
	{
		if( !pyArgs )
			Py_RETURN_NONE;
		cocos2d::CCNode *node = NULL;
		static char* kwlist[] = {"child", "cleanup", NULL};
		PyObject *child 	= NULL;
		bool cleanup		= false;
		if (!PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"O|b",kwlist,&child,&cleanup))
			Py_RETURN_NONE;
		if(!child || child == Py_None)
			Py_RETURN_NONE;
		CPyCCObject *pv = (CPyCCObject *)child;
		if(!pv)
			Py_RETURN_NONE;
		node = dynamic_cast<cocos2d::CCNode *>(pv->getCCObject());
		if(node)
		{
			CCNODE_METHOD_WRAPPER_SETER(CPyNode, removeChild, node, cleanup);
		}
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_KW_IMPL(CPyNode,removeChildByTag)
	{
		if( !pyArgs )
			Py_RETURN_NONE;
		static char* kwlist[] = {"tag", "cleanup", NULL};
		int tag 			= 0;
		bool cleanup		= false;
		if (!PyArg_ParseTupleAndKeywords(pyArgs,pyKW,"i|b",kwlist,&tag,&cleanup))
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, removeChildByTag, tag, cleanup);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,removeAllChildren)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, removeAllChildren);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,removeAllChildrenWithCleanup)
	{
		PyObject *pv = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pv) )
			Py_RETURN_NONE;
		bool v = pv == Py_True;
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, removeAllChildrenWithCleanup, v);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,reorderChild)
	{
		int v = 0;
		cocos2d::CCNode *node = NULL;
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "Oi", &pynode, &v) )
			Py_RETURN_NONE;
		CPyCCObject *pv = (CPyCCObject *)pynode;
		if(!pv)
			Py_RETURN_NONE;
		node = dynamic_cast<cocos2d::CCNode *>(pv->getCCObject());
		if(node)
		{
			CCNODE_METHOD_WRAPPER_SETER(CPyNode, reorderChild, node, v);
		}
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,sortAllChildren)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, sortAllChildren);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,onEnter)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,onEnterTransitionDidFinish)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,onExit)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,onExitTransitionDidStart)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,cleanup)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, cleanup);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,draw)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, draw);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,visit)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, visit);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,runAction)
	{
		cocos2d::CCNode *node = NULL;
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyCCObject *pv = (CPyCCObject *)pynode;
		if(!pv)
			Py_RETURN_NONE;
		cocos2d::CCAction *action = dynamic_cast<cocos2d::CCAction *>(pv->getCCObject());
		if(action)
		{
			CCNODE_METHOD_WRAPPER_SETER(CPyNode, runAction, action);
		}
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,stopAllActions)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, stopAllActions);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,stopAction)
	{
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyCCObject *pv = (CPyCCObject *)pynode;
		if(!pv)
			Py_RETURN_NONE;
		cocos2d::CCAction *action = dynamic_cast<cocos2d::CCAction *>(pv->getCCObject());
		if(action)
		{
			CCNODE_METHOD_WRAPPER_SETER(CPyNode, stopAction, action);
		}
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,stopActionByTag)
	{
		int tag = 0;
		if( !PyArg_ParseTuple(pyArgs, "i", &tag) )
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, stopActionByTag, tag);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,getActionByTag)
	{
		int tag = 0;
		if( !PyArg_ParseTuple(pyArgs, "i", &tag) )
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_GETER(CPyNode, getActionByTag, cocos2d::CCAction *, tag);
		CPyAction *node = CPyCCObject::create<CPyAction>(v);
		if(node)
			return (PyObject *)node;
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,isScheduled)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,scheduleUpdate)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, scheduleUpdate);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,scheduleUpdateWithPriority)
	{
		int priority = 0;
		if( !PyArg_ParseTuple(pyArgs, "i", &priority) )
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, scheduleUpdateWithPriority, priority);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,unscheduleUpdate)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, unscheduleUpdate);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,schedule)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,scheduleOnce)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,unschedule)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,unscheduleAllSelectors)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, unscheduleAllSelectors);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,resumeSchedulerAndActions)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, resumeSchedulerAndActions);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,pauseSchedulerAndActions)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, resumeSchedulerAndActions);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,transform)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, transform);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,transformAncestors)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, transformAncestors);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,updateTransform)
	{
		CCNODE_METHOD_WRAPPER_SETER(CPyNode, updateTransform);
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,nodeToParentTransform)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,parentToNodeTransform)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,nodeToWorldTransform)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,worldToNodeTransform)
	{
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,convertToNodeSpace)
	{
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyPoint *pv = (CPyPoint *)(pynode);
		if(!pv)
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_GETER(CPyNode, convertToNodeSpace, cocos2d::CCPoint, pv->getCCObject());
		CPyPoint *nv = CPyPoint::create(v);
		return (PyObject *)nv;
	}
	PYCLASS_METHOD_IMPL(CPyNode,convertToWorldSpace)
	{
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyPoint *pv = (CPyPoint *)(pynode);
		if(!pv)
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_GETER(CPyNode, convertToWorldSpace, cocos2d::CCPoint, pv->getCCObject());
		CPyPoint *nv = CPyPoint::create(v);
		return (PyObject *)nv;
	}
	PYCLASS_METHOD_IMPL(CPyNode,convertToNodeSpaceAR)
	{
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyPoint *pv = (CPyPoint *)(pynode);
		if(!pv)
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_GETER(CPyNode, convertToNodeSpaceAR, cocos2d::CCPoint, pv->getCCObject());
		CPyPoint *nv = CPyPoint::create(v);
		return (PyObject *)nv;
	}
	PYCLASS_METHOD_IMPL(CPyNode,convertToWorldSpaceAR)
	{
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyPoint *pv = (CPyPoint *)(pynode);
		if(!pv)
			Py_RETURN_NONE;
		CCNODE_METHOD_WRAPPER_GETER(CPyNode, convertToWorldSpaceAR, cocos2d::CCPoint, pv->getCCObject());
		CPyPoint *nv = CPyPoint::create(v);
		return (PyObject *)nv;
	}
	PYCLASS_METHOD_IMPL(CPyNode,convertTouchToNodeSpace)
	{
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyCCObject *pv = (CPyCCObject *)pynode;
		if(!pv)
			Py_RETURN_NONE;
		cocos2d::CCTouch *touch = dynamic_cast<cocos2d::CCTouch *>(pv->getCCObject());
		if(touch)
		{
			CCNODE_METHOD_WRAPPER_GETER(CPyNode, convertTouchToNodeSpace, cocos2d::CCPoint, touch);
			CPyPoint *nv = CPyPoint::create(v);
			return (PyObject *)nv;
		}
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,convertTouchToNodeSpaceAR)
	{
		PyObject *pynode = NULL;
		if( !PyArg_ParseTuple(pyArgs, "O", &pynode) )
			Py_RETURN_NONE;
		CPyCCObject *pv = (CPyCCObject *)pynode;
		if(!pv)
			Py_RETURN_NONE;
		cocos2d::CCTouch *touch = dynamic_cast<cocos2d::CCTouch *>(pv->getCCObject());
		if(touch)
		{
			CCNODE_METHOD_WRAPPER_GETER(CPyNode, convertTouchToNodeSpaceAR, cocos2d::CCPoint, touch);
			CPyPoint *nv = CPyPoint::create(v);
			return (PyObject *)nv;
		}
		Py_RETURN_NONE;
	}
	PYCLASS_METHOD_IMPL(CPyNode,setAdditionalTransform)
	{
		Py_RETURN_NONE;
	}
	/////////////////////////////////////////////////////////////////////	
	PYCLASS_INIT_AND_BASE_2(CPyNodeRGBA, CPyNode, CPyRGBAProtocol, "CCNodeRGBA", "Python CCNodeRGBA Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyNodeRGBA)
	PYCLASS_END_METHOD_DEF(CPyNodeRGBA)
	PYCLASS_BEGIN_GETSET_DEF(CPyNodeRGBA)
	PYCLASS_END_GETSET_DEF(CPyNodeRGBA)
	PYCLASS_IMP_INTERFACE(CPyNodeRGBA)
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_AND_BASE(CPyScene, CPyNode, "CCScene", "Python CCScene Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyScene)
	PYCLASS_END_METHOD_DEF(CPyScene)
	PYCLASS_BEGIN_GETSET_DEF(CPyScene)
	PYCLASS_END_GETSET_DEF(CPyScene)
	PYCLASS_IMP_INTERFACE(CPyScene)

	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyPoint, "CCPoint", "Python CCPoint Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyPoint)
	PYCLASS_END_METHOD_DEF(CPyPoint)
	PYCLASS_BEGIN_GETSET_DEF(CPyPoint)
	PYCLASS_ADD_GETSET(CPyPoint, x)
	PYCLASS_ADD_GETSET(CPyPoint, y)
	PYCLASS_END_GETSET_DEF(CPyPoint)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyPoint);
		
	int CPyPoint::__init__(CPyPoint *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"x", "y", NULL};
		float x = 0;
		float y = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|ff",kwlist, &x, &y))
			return 0;
		pySelf->m_ccobj = cocos2d::CCPointMake(x,y);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyPoint, x)
	{
		return Py_BuildValue("f", pySelf->getCCObject().x);
	}

	PYCLASS_SET_IMPL(CPyPoint, x)
	{
		pySelf->getCCObject().x = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyPoint, y)
	{
		return Py_BuildValue("f", pySelf->getCCObject().y);
	}
	PYCLASS_SET_IMPL(CPyPoint, y)
	{
		pySelf->getCCObject().y = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////	
	PYCLASS_INIT_F(CPySize, "CCSize", "Python CCSize Object");
	PYCLASS_BEGIN_METHOD_DEF(CPySize)
	PYCLASS_END_METHOD_DEF(CPySize)
	PYCLASS_BEGIN_GETSET_DEF(CPySize)
	PYCLASS_ADD_GETSET(CPySize, width)
	PYCLASS_ADD_GETSET(CPySize, height)
	PYCLASS_END_GETSET_DEF(CPySize)
	PYCLASS_IMP_INTERFACE_NOINIT(CPySize);
		
	int CPySize::__init__(CPySize *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"width", "height", NULL};
		float w = 0;
		float h = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|ff",kwlist, &w, &h))
			return 0;
		pySelf->m_ccobj = cocos2d::CCSizeMake(w, h);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPySize, width)
	{
		return Py_BuildValue("f", pySelf->getCCObject().width);
	}

	PYCLASS_SET_IMPL(CPySize, width)
	{
		pySelf->getCCObject().width = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPySize, height)
	{
		return Py_BuildValue("f", pySelf->getCCObject().height);
	}
	PYCLASS_SET_IMPL(CPySize, height)
	{
		pySelf->getCCObject().height = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////	
	PYCLASS_INIT_F(CPyRect, "CCRect", "Python CCRect Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyRect)
	PYCLASS_END_METHOD_DEF(CPyRect)
	PYCLASS_BEGIN_GETSET_DEF(CPyRect)
	PYCLASS_ADD_GETSET(CPyRect, origin)
	PYCLASS_ADD_GETSET(CPyRect, size)
	PYCLASS_END_GETSET_DEF(CPyRect)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyRect);
		
	int CPyRect::__init__(CPyRect *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"x", "y", "width", "height", NULL};
		float x = 0;
		float y = 0;
		float w = 0;
		float h = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|ffff",kwlist, &x, &y, &w, &h))
			return 0;
		pySelf->m_ccobj = cocos2d::CCRectMake(x, y, w, h);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyRect, origin)
	{
		CPyPoint *pt = CPyPoint::create(pySelf->getCCObject().origin);
		if(pt)
			return (PyObject *)pt;
		Py_RETURN_NONE;
	}

	PYCLASS_SET_IMPL(CPyRect, origin)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyPoint>()))
		{
			return 0;
		}
		CPyPoint *pypt = (CPyPoint *)pyValue;
		pySelf->getCCObject().origin = pypt->getCCObject();
		return 0;
	}
	PYCLASS_GET_IMPL(CPyRect, size)
	{
		CPySize *si = CPySize::create(pySelf->getCCObject().size);
		if(si)
			return (PyObject *)si;
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyRect, size)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPySize>()))
		{
			return 0;
		}
		CPySize *pysi = (CPySize *)pyValue;
		pySelf->getCCObject().size = pysi->getCCObject();
		return 0;
	}
	/////////////////////////////////////////////////////////////////////	
	PYCLASS_INIT_F(CPyColor3B, "ccColor3B", "Python ccColor3B Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyColor3B)
	PYCLASS_END_METHOD_DEF(CPyColor3B)
	PYCLASS_BEGIN_GETSET_DEF(CPyColor3B)
	PYCLASS_ADD_GETSET(CPyColor3B, r)
	PYCLASS_ADD_GETSET(CPyColor3B, g)
	PYCLASS_ADD_GETSET(CPyColor3B, b)
	PYCLASS_END_GETSET_DEF(CPyColor3B)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyColor3B);
		
	int CPyColor3B::__init__(CPyColor3B *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"r", "g", "b", NULL};
		int r = 0;
		int g = 0;
		int b = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|iii",kwlist, &r, &g, &b))
			return 0;
		pySelf->m_ccobj = cocos2d::ccc3(r,g,b);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyColor3B, r)
	{
		return Py_BuildValue("i", pySelf->getCCObject().r);
	}

	PYCLASS_SET_IMPL(CPyColor3B, r)
	{
		pySelf->getCCObject().r = (GLbyte)PyLong_AsLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor3B, g)
	{
		return Py_BuildValue("i", pySelf->getCCObject().g);
	}
	PYCLASS_SET_IMPL(CPyColor3B, g)
	{
		pySelf->getCCObject().g = (GLbyte)PyLong_AsLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor3B, b)
	{
		return Py_BuildValue("i", pySelf->getCCObject().b);
	}
	PYCLASS_SET_IMPL(CPyColor3B, b)
	{
		pySelf->getCCObject().b = (GLbyte)PyLong_AsLong(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyColor4B, "ccColor4B", "Python ccColor4B Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyColor4B)
	PYCLASS_END_METHOD_DEF(CPyColor4B)
	PYCLASS_BEGIN_GETSET_DEF(CPyColor4B)
	PYCLASS_ADD_GETSET(CPyColor4B, r)
	PYCLASS_ADD_GETSET(CPyColor4B, g)
	PYCLASS_ADD_GETSET(CPyColor4B, b)
	PYCLASS_ADD_GETSET(CPyColor4B, a)
	PYCLASS_END_GETSET_DEF(CPyColor4B)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyColor4B);
		
	int CPyColor4B::__init__(CPyColor4B *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"r", "g", "b", "a", NULL};
		int r = 0;
		int g = 0;
		int b = 0;
		int a = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|iiii",kwlist, &r, &g, &b, &a))
			return 0;
		pySelf->m_ccobj = cocos2d::ccc4(r,g,b,a);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyColor4B, r)
	{
		return Py_BuildValue("i", pySelf->getCCObject().r);
	}

	PYCLASS_SET_IMPL(CPyColor4B, r)
	{
		pySelf->getCCObject().r = (GLbyte)PyLong_AsLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor4B, g)
	{
		return Py_BuildValue("i", pySelf->getCCObject().g);
	}
	PYCLASS_SET_IMPL(CPyColor4B, g)
	{
		pySelf->getCCObject().g = (GLbyte)PyLong_AsLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor4B, b)
	{
		return Py_BuildValue("i", pySelf->getCCObject().b);
	}
	PYCLASS_SET_IMPL(CPyColor4B, b)
	{
		pySelf->getCCObject().b = (GLbyte)PyLong_AsLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor4B, a)
	{
		return Py_BuildValue("i", pySelf->getCCObject().a);
	}
	PYCLASS_SET_IMPL(CPyColor4B, a)
	{
		pySelf->getCCObject().a = (GLbyte)PyLong_AsLong(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyColor4F, "ccColor4F", "Python ccColor4F Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyColor4F)
	PYCLASS_END_METHOD_DEF(CPyColor4F)
	PYCLASS_BEGIN_GETSET_DEF(CPyColor4F)
	PYCLASS_ADD_GETSET(CPyColor4F, r)
	PYCLASS_ADD_GETSET(CPyColor4F, g)
	PYCLASS_ADD_GETSET(CPyColor4F, b)
	PYCLASS_ADD_GETSET(CPyColor4F, a)
	PYCLASS_END_GETSET_DEF(CPyColor4F)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyColor4F);
		
	int CPyColor4F::__init__(CPyColor4F *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"r", "g", "b", "a", NULL};
		float r = 0;
		float g = 0;
		float b = 0;
		float a = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|ffff",kwlist, &r, &g, &b, &a))
			return 0;
		pySelf->m_ccobj = cocos2d::ccc4f(r,g,b,a);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyColor4F, r)
	{
		return Py_BuildValue("f", pySelf->getCCObject().r);
	}

	PYCLASS_SET_IMPL(CPyColor4F, r)
	{
		pySelf->getCCObject().r = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor4F, g)
	{
		return Py_BuildValue("f", pySelf->getCCObject().g);
	}
	PYCLASS_SET_IMPL(CPyColor4F, g)
	{
		pySelf->getCCObject().g = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor4F, b)
	{
		return Py_BuildValue("f", pySelf->getCCObject().b);
	}
	PYCLASS_SET_IMPL(CPyColor4F, b)
	{
		pySelf->getCCObject().b = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyColor4F, a)
	{
		return Py_BuildValue("f", pySelf->getCCObject().a);
	}
	PYCLASS_SET_IMPL(CPyColor4F, a)
	{
		pySelf->getCCObject().a = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyVertex2F, "ccVertex2F", "Python ccVertex2F Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyVertex2F)
	PYCLASS_END_METHOD_DEF(CPyVertex2F)
	PYCLASS_BEGIN_GETSET_DEF(CPyVertex2F)
	PYCLASS_ADD_GETSET(CPyVertex2F, x)
	PYCLASS_ADD_GETSET(CPyVertex2F, y)
	PYCLASS_END_GETSET_DEF(CPyVertex2F)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyVertex2F);
		
	int CPyVertex2F::__init__(CPyVertex2F *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"x", "y", NULL};
		float x = 0;
		float y = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|ff",kwlist, &x, &y))
			return 0;
		pySelf->m_ccobj = cocos2d::vertex2(x,y);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyVertex2F, x)
	{
		return Py_BuildValue("f", pySelf->getCCObject().x);
	}

	PYCLASS_SET_IMPL(CPyVertex2F, x)
	{
		pySelf->getCCObject().x = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyVertex2F, y)
	{
		return Py_BuildValue("f", pySelf->getCCObject().y);
	}
	PYCLASS_SET_IMPL(CPyVertex2F, y)
	{
		pySelf->getCCObject().y = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyVertex3F, "ccVertex3F", "Python ccVertex3F Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyVertex3F)
	PYCLASS_END_METHOD_DEF(CPyVertex3F)
	PYCLASS_BEGIN_GETSET_DEF(CPyVertex3F)
	PYCLASS_ADD_GETSET(CPyVertex3F, x)
	PYCLASS_ADD_GETSET(CPyVertex3F, y)
	PYCLASS_ADD_GETSET(CPyVertex3F, z)
	PYCLASS_END_GETSET_DEF(CPyVertex3F)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyVertex3F);
		
	int CPyVertex3F::__init__(CPyVertex3F *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"x", "y", "z", NULL};
		float x = 0;
		float y = 0;
		float z = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|fff",kwlist, &x, &y, &z))
			return 0;
		pySelf->m_ccobj = cocos2d::vertex3(x,y,z);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyVertex3F, x)
	{
		return Py_BuildValue("f", pySelf->getCCObject().x);
	}

	PYCLASS_SET_IMPL(CPyVertex3F, x)
	{
		pySelf->getCCObject().x = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyVertex3F, y)
	{
		return Py_BuildValue("f", pySelf->getCCObject().y);
	}
	PYCLASS_SET_IMPL(CPyVertex3F, y)
	{
		pySelf->getCCObject().y = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyVertex3F, z)
	{
		return Py_BuildValue("f", pySelf->getCCObject().z);
	}
	PYCLASS_SET_IMPL(CPyVertex3F, z)
	{
		pySelf->getCCObject().z = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyTex2F, "ccTex2F", "Python ccTex2F Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyTex2F)
	PYCLASS_END_METHOD_DEF(CPyTex2F)
	PYCLASS_BEGIN_GETSET_DEF(CPyTex2F)
	PYCLASS_ADD_GETSET(CPyTex2F, u)
	PYCLASS_ADD_GETSET(CPyTex2F, v)
	PYCLASS_END_GETSET_DEF(CPyTex2F)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyTex2F);
		
	int CPyTex2F::__init__(CPyTex2F *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"u", "v", NULL};
		float u = 0;
		float v = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|ff",kwlist, &u, &v))
			return 0;
		pySelf->m_ccobj = cocos2d::tex2(u,v);
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyTex2F, u)
	{
		return Py_BuildValue("f", pySelf->getCCObject().u);
	}

	PYCLASS_SET_IMPL(CPyTex2F, u)
	{
		pySelf->getCCObject().u = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyTex2F, v)
	{
		return Py_BuildValue("f", pySelf->getCCObject().v);
	}
	PYCLASS_SET_IMPL(CPyTex2F, v)
	{
		pySelf->getCCObject().v = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyBlendFunc, "ccBlendFunc", "Python ccBlendFunc Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyBlendFunc)
	PYCLASS_END_METHOD_DEF(CPyBlendFunc)
	PYCLASS_BEGIN_GETSET_DEF(CPyBlendFunc)
	PYCLASS_ADD_GETSET(CPyBlendFunc, src)
	PYCLASS_ADD_GETSET(CPyBlendFunc, dst)
	PYCLASS_END_GETSET_DEF(CPyBlendFunc)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyBlendFunc);
		
	int CPyBlendFunc::__init__(CPyBlendFunc *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"src", "dst", NULL};
		GLenum src = GL_ZERO;
		GLenum dst = GL_ZERO;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|II",kwlist, &src, &dst))
			return 0;
		pySelf->m_ccobj.src = src;
		pySelf->m_ccobj.dst = dst;
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyBlendFunc, src)
	{
		return Py_BuildValue("I", pySelf->getCCObject().src);
	}

	PYCLASS_SET_IMPL(CPyBlendFunc, src)
	{
		pySelf->getCCObject().src = (GLenum)PyLong_AsUnsignedLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyBlendFunc, dst)
	{
		return Py_BuildValue("I", pySelf->getCCObject().dst);
	}
	PYCLASS_SET_IMPL(CPyBlendFunc, dst)
	{
		pySelf->getCCObject().dst = (GLenum)PyLong_AsUnsignedLong(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	PYCLASS_INIT_F(CPyTexParams, "ccTexParams", "Python ccTexParams Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyTexParams)
	PYCLASS_END_METHOD_DEF(CPyTexParams)
	PYCLASS_BEGIN_GETSET_DEF(CPyTexParams)
	PYCLASS_ADD_GETSET(CPyTexParams, minFilter)
	PYCLASS_ADD_GETSET(CPyTexParams, magFilter)
	PYCLASS_ADD_GETSET(CPyTexParams, wrapS)
	PYCLASS_ADD_GETSET(CPyTexParams, wrapT)
	PYCLASS_END_GETSET_DEF(CPyTexParams)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyTexParams);
		
	int CPyTexParams::__init__(CPyTexParams *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"minFilter", "magFilter", "wrapS", "wrapT", NULL};
		GLuint minFilter = 0;
		GLuint magFilter = 0;
		GLuint wrapS = 0;
		GLuint wrapT = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|IIII",kwlist, &minFilter, &magFilter, &wrapS, &wrapT))
			return 0;
		pySelf->m_ccobj.minFilter = minFilter;
		pySelf->m_ccobj.magFilter = magFilter;
		pySelf->m_ccobj.wrapS = wrapS;
		pySelf->m_ccobj.wrapT = wrapT;
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyTexParams, minFilter)
	{
		return Py_BuildValue("I", pySelf->getCCObject().minFilter);
	}

	PYCLASS_SET_IMPL(CPyTexParams, minFilter)
	{
		pySelf->getCCObject().minFilter = (GLuint)PyLong_AsUnsignedLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyTexParams, magFilter)
	{
		return Py_BuildValue("I", pySelf->getCCObject().magFilter);
	}
	PYCLASS_SET_IMPL(CPyTexParams, magFilter)
	{
		pySelf->getCCObject().magFilter = (GLuint)PyLong_AsUnsignedLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyTexParams, wrapS)
	{
		return Py_BuildValue("I", pySelf->getCCObject().wrapS);
	}

	PYCLASS_SET_IMPL(CPyTexParams, wrapS)
	{
		pySelf->getCCObject().wrapS = (GLuint)PyLong_AsUnsignedLong(pyValue);
		return 0;
	}
	PYCLASS_GET_IMPL(CPyTexParams, wrapT)
	{
		return Py_BuildValue("I", pySelf->getCCObject().wrapT);
	}
	PYCLASS_SET_IMPL(CPyTexParams, wrapT)
	{
		pySelf->getCCObject().wrapT = (GLuint)PyLong_AsUnsignedLong(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////	
	PYCLASS_INIT_F(CPyPointSprite, "ccPointSprite", "Python ccPointSprite Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyPointSprite)
	PYCLASS_END_METHOD_DEF(CPyPointSprite)
	PYCLASS_BEGIN_GETSET_DEF(CPyPointSprite)
	PYCLASS_ADD_GETSET(CPyPointSprite, pos)
	PYCLASS_ADD_GETSET(CPyPointSprite, color)
	PYCLASS_ADD_GETSET(CPyPointSprite, size)
	PYCLASS_END_GETSET_DEF(CPyPointSprite)
	PYCLASS_IMP_INTERFACE_NOINIT(CPyPointSprite);
		
	int CPyPointSprite::__init__(CPyPointSprite *pySelf, PyObject *args, PyObject *kwds)
	{
		if( !args )
			return 0;
		static char* kwlist[] = {"pos", "color", "size", NULL};
		PyObject *pyPos = NULL;
		PyObject *pyColor = NULL;
		float size = 0;
		if (!PyArg_ParseTupleAndKeywords(args,kwds,"|OOf",kwlist, &pyPos, &pyColor, &size))
			return 0;
		if(PyObject_TypeCheck(pyPos, CPyClassBase::GetTypeObject<CPyVertex2F>()))
		{
			CPyVertex2F *vt = (CPyVertex2F *)pyPos;
			pySelf->m_ccobj.pos = vt->getCCObject();
		}
		if(PyObject_TypeCheck(pyPos, CPyClassBase::GetTypeObject<CPyColor4B>()))
		{
			CPyColor4B *cb = (CPyColor4B *)pyColor;
			pySelf->m_ccobj.color = cb->getCCObject();
		}
		pySelf->m_ccobj.size = size;
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyPointSprite, color)
	{
		CPyColor4B *pt = CPyColor4B::create(pySelf->getCCObject().color);
		if(pt)
			return (PyObject *)pt;
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyPointSprite, color)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyColor4B>()))
		{
			return 0;
		}
		CPyColor4B *pysi = (CPyColor4B *)pyValue;
		pySelf->getCCObject().color = pysi->getCCObject();
		return 0;
	}

	PYCLASS_GET_IMPL(CPyPointSprite, pos)
	{
		CPyVertex2F *si = CPyVertex2F::create(pySelf->getCCObject().pos);
		if(si)
			return (PyObject *)si;
		Py_RETURN_NONE;
	}
	PYCLASS_SET_IMPL(CPyPointSprite, pos)
	{
		if(!PyObject_TypeCheck(pyValue, CPyClassBase::GetTypeObject<CPyVertex2F>()))
		{
			return 0;
		}
		CPyVertex2F *pysi = (CPyVertex2F *)pyValue;
		pySelf->getCCObject().pos = pysi->getCCObject();
		return 0;
	}

	PYCLASS_GET_IMPL(CPyPointSprite, size)
	{
		return Py_BuildValue("f", pySelf->getCCObject().size);
	}
	PYCLASS_SET_IMPL(CPyPointSprite, size)
	{
		pySelf->getCCObject().size = (float)PyFloat_AsDouble(pyValue);
		return 0;
	}
	/////////////////////////////////////////////////////////////////////
	CC_QUAD_IMPL(CPyQuad2, CPyVertex2F, "ccQuad2", "Python ccQuad2 Object")
	CC_QUAD_IMPL(CPyQuad3, CPyVertex3F, "ccQuad3", "Python ccQuad3 Object")
	CC_QUAD_IMPL(CPyV2F_C4B_T2F_Quad, CPyV2F_C4B_T2F, "ccV2F_C4B_T2F_Quad", "Python ccV2F_C4B_T2F_Quad Object")
	CC_QUAD_IMPL(CPyV3F_C4B_T2F_Quad, CPyV3F_C4B_T2F, "ccV3F_C4B_T2F_Quad", "Python ccV3F_C4B_T2F_Quad Object")
	CC_QUAD_IMPL(CPyV2F_C4F_T2F_Quad, CPyV2F_C4F_T2F, "ccV2F_C4F_T2F_Quad", "Python ccV2F_C4F_T2F_Quad Object")
	CC_QUAD_IMPL(CPyT2F_Quad, CPyTex2F, "ccT2F_Quad", "Python ccT2F_Quad Object")
	/////////////////////////////////////////////////////////////////////
	CC_VERTEXPOINT_IMPL(CPyV2F_C4B_T2F, CPyVertex2F, CPyColor4B, "ccV2F_C4B_T2F", "Python ccV2F_C4B_T2F Object")
	CC_VERTEXPOINT_IMPL(CPyV2F_C4F_T2F, CPyVertex2F, CPyColor4F, "ccV2F_C4F_T2F", "Python ccV2F_C4F_T2F Object")
	CC_VERTEXPOINT_IMPL(CPyV3F_C4B_T2F, CPyVertex3F, CPyColor4B, "ccV3F_C4B_T2F", "Python ccV3F_C4B_T2F Object")
	/////////////////////////////////////////////////////////////////////

	PYCLASS_INIT_F(CPyAcceleration, "CCAcceleration", "Python CCAcceleration Object");
	PYCLASS_BEGIN_METHOD_DEF(CPyAcceleration)
	PYCLASS_END_METHOD_DEF(CPyAcceleration)
	PYCLASS_BEGIN_GETSET_DEF(CPyAcceleration)
	PYCLASS_ADD_GETSET(CPyAcceleration, x)
	PYCLASS_ADD_GETSET(CPyAcceleration, y)
	PYCLASS_ADD_GETSET(CPyAcceleration, z)
	PYCLASS_ADD_GETSET(CPyAcceleration, timestamp)
	PYCLASS_END_GETSET_DEF(CPyAcceleration)
	PYCLASS_IMP_INTERFACE(CPyAcceleration);
	
	PYCLASS_GET_IMPL(CPyAcceleration, x)
	{
		return Py_BuildValue("d", pySelf->getCCObject()->x);
	}
	PYCLASS_SET_IMPL(CPyAcceleration, x)
	{
		double dbv = PyFloat_AsDouble(pyValue);
		pySelf->getCCObject()->x = dbv;
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyAcceleration, y)
	{
		return Py_BuildValue("d", pySelf->getCCObject()->y);
	}
	PYCLASS_SET_IMPL(CPyAcceleration, y)
	{
		double dbv = PyFloat_AsDouble(pyValue);
		pySelf->getCCObject()->y = dbv;
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyAcceleration, z)
	{
		return Py_BuildValue("d", pySelf->getCCObject()->z);
	}
	PYCLASS_SET_IMPL(CPyAcceleration, z)
	{
		double dbv = PyFloat_AsDouble(pyValue);
		pySelf->getCCObject()->z = dbv;
		return 0;
	}
	
	PYCLASS_GET_IMPL(CPyAcceleration, timestamp)
	{
		return Py_BuildValue("d", pySelf->getCCObject()->timestamp);
	}
	PYCLASS_SET_IMPL(CPyAcceleration, timestamp)
	{
		double dbv = PyFloat_AsDouble(pyValue);
		pySelf->getCCObject()->timestamp = dbv;
		return 0;
	}

	/////////////////////////////////////////////////////////////////////
		
	CallFuncDelegate *CallFuncDelegate::share()
	{
		static CallFuncDelegate cd;
		return &cd;
	}

	CallFuncDelegate *CallFuncDelegate::create(PyObject *fn)
	{
		return new CallFuncDelegate(fn);		
	}

	void CallFuncDelegate::On_SEL_CallFuncND(cocos2d::CCNode* N, void* P)
	{
		if(P)
		{
			LPY_CALLFUNC_CB_INFO pinfo = (LPY_CALLFUNC_CB_INFO)P;
			IWrapper *wrap = dynamic_cast<IWrapper *>(N);
			PyObject *node = NULL;
			if(wrap)
			{
				node = CPyCCObject::create_object(wrap->GetPythonType(), N);
			}else
				node = (PyObject *)CPyCCObject::create<CPyCCObject>(N);

			if(pinfo->need_param && pinfo->need_current)
			{
				PyObject *params = PyTuple_Pack(2, node, pinfo->data);
				PyObject_Call(pinfo->pyFunc, params, NULL);
				Py_SAFE_DECREF(params);
			}else if(pinfo->need_current){
				PyObject *params = PyTuple_Pack(1, node);
				PyObject_Call(pinfo->pyFunc, params, NULL);
				Py_SAFE_DECREF(params);
			}else if(pinfo->need_param){
				PyObject *params = PyTuple_Pack(1, pinfo->data);
				PyObject_Call(pinfo->pyFunc, params, NULL);
				Py_SAFE_DECREF(params);
			}else
				PyObject_CallFunction(pinfo->pyFunc, NULL);
			//Py_SAFE_DECREF(pinfo->data);
			//Py_SAFE_DECREF(pinfo->pyFunc);
			//delete pinfo;
		}
	}

	void CallFuncDelegate::On_SEL_CallFuncO(cocos2d::CCObject* O)
	{
		IWrapper *wrap = dynamic_cast<IWrapper *>(O);
		PyObject *pyo = NULL;
		if(wrap)
		{
			pyo = CPyCCObject::create_object(wrap->GetPythonType(), O);
		}else
			pyo = (PyObject *)CPyCCObject::create<CPyCCObject>(O);

		if(m_fn)
			PyObject_Call(m_fn, PyTuple_Pack(1, pyo), NULL);
		Py_SAFE_DECREF(m_fn);
		this->release();
	}

NS_CCPY_END

#endif